import time
from timeloop import Timeloop
from datetime import timedelta

tl = Timeloop()


# Timeloop是一个库，可用于运行多周期任务。这是一个简单的库，它使用decorator模式在线程中运行标记函数。

@tl.job(interval=timedelta(seconds=2))
def simple_job_every_2s():
    print("2s job current time : {}".format(time.ctime()))


@tl.job(interval=timedelta(seconds=5))
def simple_job_every_5s():
    print("5s job current time : {}".format(time.ctime()))


@tl.job(interval=timedelta(seconds=10))
def simple_job_every_10s():
    print("10s job current time : {}".format(time.ctime()))
